<?php

namespace maotool\util;

/**
 * 获取框架信息
 */
class ProjectUtil
{

    public static function getName()
    {
        return ComposerUtil::get("name");
    }

    public static function getType()
    {
        return ComposerUtil::get("type");
    }

    public static function getHomepage()
    {
        return ComposerUtil::get("homepage");
    }

    public static function getKeywords()
    {
        return ComposerUtil::get("keywords");
    }

    public static function getVersion()
    {
        return ComposerUtil::get("version");
    }

    public static function getDescription()
    {
        return ComposerUtil::get("description");
    }

    public static function isThinkphp()
    {
        $setting = ComposerUtil::read();
        if (isset($setting["require"]["topthink/framework"])) {
            return true;
        }
        return false;
    }

    public static function isFastAdmin()
    {
        $setting = ComposerUtil::read();
        if (isset($setting["require"]["karsonzhang/fastadmin-addons"])) {
            return true;
        }
        return false;
    }

    public static function isLaravel()
    {
        $setting = ComposerUtil::read();
        if (isset($setting["require"]["laravel/framework"])) {
            return true;
        }
        return false;
    }

}